namespace NMockEvents.App
{
    public class AccountSummaryPresenter
    {
        private readonly IAccountSummaryView view;

        public AccountSummaryPresenter(IAccountSummaryView view)
        {
            this.view = view;
            HookupEventHandlers(view);
        }

        private void HookupEventHandlers(IAccountSummaryView view)
        {
            view.Load += delegate { LoadAccountsInto(view); };
        }

        private void LoadAccountsInto(IAccountSummaryView view)
        {
            view.Display(GetAccountSummaries());
        }

        private AccountSummaryDTO[] GetAccountSummaries()
        {
            // probably goes off to a service layer to grab some account summaries
            // but we'll just return an empty array here...
            return new AccountSummaryDTO[0];
        }
    }
}